<script setup lang="ts">
const props = defineProps<{
  money: number
  modelValue: number
}>()
const emit = defineEmits<{
  (e: 'update:money', val: number): void
  (e: 'update:modelValue', val: number): void
}>()
const onClick = () => {
  emit('update:money', props.money - 10)
}
const addScore = () => {
  emit('update:modelValue', props.modelValue - 10)
}
</script>

<template>
  <div class="soncom-page">
    <h1>{{ props.money }}--{{ modelValue }}</h1>
    <button @click="onClick">costMoney</button>
    <button @click="addScore">addSotre</button>
  </div>
</template>

<style scoped></style>
